﻿@using CMSMVC4.MultiResource
@model System.Data.DataTable

@if (Model != null)
{
    int count = 4;
    if (Model.Rows.Count < 4)
    {
        count = Model.Rows.Count;
    }
    <div id="main_mid">
        @for (int i = 0; i < count; i++)
        {
            if (i == 0)
            {
            <div class="mid_imagemenu_start">
                <div class="mid_imagemenu_title" align="center">
                    <div class="imagemenu_title_mid">
                        <a href="@Model.Rows[i]["Url"].ToString()">
                            <img src="@Model.Rows[i]["Icon"].ToString()" border="0"/></a>
                        <div class="mid_imagemenu_title_label">
                            <a href="@Model.Rows[i]["Url"].ToString()">@Model.Rows[i]["Name"].ToString() </a>
                        </div>
                    </div>
                </div>
                <div class="mid_imagemenu_img">
                    <a href="@Model.Rows[i]["Url"].ToString()">
                        <img src="@Model.Rows[i]["Image"].ToString()" width="233" height="140" alt="gioithieu" border="0" /></a></div>
                <div class="mid_imagemenu_sadowimg">
                </div>
                <div class="mid_imagemenu_descriotion">
                    @{Html.RenderAction("MenuSummary", "Menu", new { type =Model.Rows[i]["Type"].ToString()});}
                </div>
                <div class="mid_imagemenu_more" align="right">
                    <a href="@Model.Rows[i]["Url"].ToString()">@Resource.Readmore</a></div>
            </div>
            }
            else if (i == (count-1))
            {
            <div class="mid_imagemenu_end">
                <div class="mid_imagemenu_title" align="center">
                    <div class="imagemenu_title_mid">
                        <a href="@Model.Rows[i]["Url"].ToString()">
                            <img src="@Model.Rows[i]["Icon"].ToString()" border="0"/></a>
                        <div class="mid_imagemenu_title_label">
                            <a href="@Model.Rows[i]["Url"].ToString()">@Model.Rows[i]["Name"].ToString() </a>
                        </div>
                    </div>
                </div>
                <div class="mid_imagemenu_img">
                    <a href="@Model.Rows[i]["Url"].ToString()">
                        <img src="@Model.Rows[i]["Image"].ToString()" width="233" height="140" alt="gioithieu" border="0" /></a></div>
                <div class="mid_imagemenu_sadowimg">
                </div>
                <div class="mid_imagemenu_descriotion">
                    @{Html.RenderAction("MenuSummary", "Menu", new { type =Model.Rows[i]["Type"].ToString()});}
                </div>
                <div class="mid_imagemenu_more" align="right">
                    <a href="@Model.Rows[i]["Url"].ToString()">@Resource.Readmore</a></div>
            </div>
            }
            else
            {
            <div class="mid_imagemenu_mid">
                <div class="mid_imagemenu_title" align="center">
                    <div class="imagemenu_title_mid">
                        <a href="@Model.Rows[i]["Url"].ToString()"><img src="@Model.Rows[i]["Icon"].ToString()" border="0" /></a>
                        <div class="mid_imagemenu_title_label">
                            <a href="@Model.Rows[i]["Url"].ToString()">@Model.Rows[i]["Name"].ToString()</a></div>
                    </div>
                </div>
                <div class="mid_imagemenu_img">
                    <a href="@Model.Rows[i]["Url"].ToString()"><img src="@Model.Rows[i]["Image"].ToString()" width="233" height="140" alt="gioithieu" border="0" /></a></div>
                <div class="mid_imagemenu_sadowimg">
                </div>
                <div class="mid_imagemenu_descriotion">
                    @{Html.RenderAction("MenuSummary", "Menu", new { type = Model.Rows[i]["Type"].ToString() });}
                </div>
                <div class="mid_imagemenu_more" align="right">
                    <a href="@Model.Rows[i]["Url"].ToString()">@Resource.Readmore</a></div>
            </div>
            }
        }
    </div>
}
